package com.euc.springbootframework.dao.base;

import com.euc.springbootframework.dao.pagination.BaseConditionQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.repository.NoRepositoryBean;

import java.util.List;

@NoRepositoryBean
public interface BaseDao<T,PK> extends MongoRepository<T, PK> {

    public Boolean exists(Query query);

    public T findOne(Query query);

    public Integer findAndModify(Criteria criteria, Update update);

    public List<T> find(Criteria criteria);

    public Page<T> findAll(BaseConditionQuery<T> baseConditionQuery);
}
